package com.atguigu.controller;

import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.ResponseBody;

/**
 * @Author: liuaojun
 * @CreateTime: 2025-01-17
 * @Description:
 * @Version: 1.0
 */
@Controller("HelloWorld")//这里是ID不是URL
@RequestMapping("/Hcontroller")
public class HelloWorld {

    @RequestMapping("/helloworld")
    @ResponseBody
    public String helloWorld() {
        return "Hello World";
    }

    @RequestMapping(value = "/test01",method = RequestMethod.GET)
    @ResponseBody
    public String test01(){
        return "test01";
    }

    @RequestMapping(value = "/test01",method = RequestMethod.POST)
    @ResponseBody
    public String test02(){
        return "test02";
    }

    @RequestMapping(value = "/test01",method = RequestMethod.DELETE)
    @ResponseBody
    public String test03(){
        return "test03";
    }

    @RequestMapping(value = "/test01",method = RequestMethod.PUT)
    @ResponseBody
    public String test04(){
        return "test04";
    }
}
